<?php
    require_once(APPPATH . '/controllers/test/Toast.php');

    class EXT_Toast extends Toast
    {

        function __construct()
        {
            parent::__construct(__FILE__);
        }

        function model_exists($model_name)
        {
            // check if model exists
            //$model = 'objects_type_model';
            if(file_exists(APPPATH."models/$model_name.php"))
            {
                return TRUE;
            }
            else{
                // model doesn't exist
                $this->message = "model $model_name doesnt exists";
                $this->_assert_true(FALSE);
                return FALSE;
            }
        }

        function func_exists($model, $method_name)
        {
            // Check if method exists on model
            if((int)method_exists($model, $method_name))
            {
                return TRUE;
            }
            else
            {
                $this->message = "metehod $method_name doesnt exists.";
                $this->_assert_true(FALSE);
                return FALSE;
            }
        }
    }
?>
